﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace DARE
{
    public class CSquareEmitterData : CEmitterData
    {
        public Vector2 Rect { get; set; }
        public bool EdgeSpawn { get; set; }

        public override void FillDataStructure(object e)
        {
            AEmitter emitter = e as AEmitter;
            base.FillDataStructure(emitter);
            Rect = (emitter as CSquareEmitter).Rect;
            EdgeSpawn = (emitter as CSquareEmitter).EdgeSpawn;
        }

        public override void FillFromDataStructure(out object e, params object[] paramsData)
        {
            base.FillFromDataStructure(out e);
            AEmitter emitter = e as AEmitter;
            (emitter as CSquareEmitter).Rect = Rect;
            (emitter as CSquareEmitter).EdgeSpawn = EdgeSpawn;
        }

        public override AEmitter CreateEmitter()
        {
            return new CSquareEmitter(Name);
        }
    }
}
